<div class="actions">
	<ul>
		<li><?php if ($curUser['User']['ROLE'] != 'admin')
					echo $html->link(__('Thêm thông tin sử dụng phân bón', true), array('action' => 'add', $sotayId)); ?></li>		
                    <li><?php echo $html->link('Danh sách sổ tay nông hộ', array('controller'=>'Sotays','action' => 'index', $nonghoId)); ?></li>
        <li><?php echo $html->link('Danh sách nông hộ', array('controller'=>'nonghos', 'action' => 'index1')); ?></li>
	  	<li><?php 
		echo $html->link('Xuất PDF', array('action' => 'xuatpdf', $sotayId)); ?>
        <li><?php 
		echo $html->link('Xuất Excel', array('action' => 'xls', $sotayId)); ?>
	</li>
		</ul>
</div>
<div class="view">
<h2><?php  __('Sổ tay');?></h2>
	<dl><?php $i = 0; $class = ' class="altrow"';?>

		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Nông hộ:'); ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>
			<?php echo $sotay['Nongho']['TEN_NH']; ?>
			&nbsp;
		</dd>
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Giống lúa:'); ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>
			<?php echo $sotay['Gionglua']['TEN_GL']; ?>
			&nbsp;
		</dd>
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Mùa vụ:'); ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>
			<?php echo $sotay['MuaVue']['TEN_MUA']; ?>
			&nbsp;
		</dd>
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Năm'); ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>
			<?php echo $sotay['Nam']['NAM']; ?>
			&nbsp;
		</dd>
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Diện tích ruộng'); ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>
			<?php echo $sotay['Sotay']['DTR']; ?>
			&nbsp;
		</dd>
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Khả năng chống chịu:'); ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>
			<?php echo $sotay['Gionglua']['KNCC']; ?>
			&nbsp;
		</dd>
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Thời gian gieo cấy'); ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>
			<?php echo $sotay['Sotay']['TGGC']; ?>
			&nbsp;
		</dd>
	</dl>
<h2><?php __('SỬ DỤNG PHÂN BÓN');?></h2>
<p>
<?php
$this->pageTitle = 'Su dung phan bon';
$paginator->options(array('url'=>$this->passedArgs));
echo $paginator->counter(array(
'format' => 'Hiện có %count% mẫu tin - Trang %page%/%pages%'
));
?></p>
<table cellpadding="0" cellspacing="0">
<tr>
	<th><?php echo $paginator->sort('STT');?></th>	
	<th><?php echo $paginator->sort('Loại phân','Loaiphan.TEN_LP');?></th>
	<th><?php echo $paginator->sort('Liều lượng phân','SdPhanbon.LL_P');?></th>
	<th><?php echo $paginator->sort('Đơn vị tính','Dvtinh.tendv');?></th>
    <th><?php echo $paginator->sort('Số ngày','SdPhanbon.songay');?></th>
	<th><?php echo $paginator->sort('Ngày bón (NSS)','Nss.TEN_NSS');?></th>
	<th><?php echo $paginator->sort('Ghi chú','SdPhanbon.GHICHU_P');?></th>
	<th class="actions"><?php echo 'Hành động';?></th>
</tr>
<?php
$i = 0;
$stt = 1;
echo $form->hidden('Sotay.id',array('value'=>$sotayId)); 
foreach ($sdPhanbons as $sdPhanbon):
	$class = null;
	if ($i++ % 2 == 0) {
		$class = ' class="altrow"';
	}
?>
	<tr<?php echo $class;?>>
		<td>
			<?php echo $stt++;?>
		</td>
		<td>
			<?php echo $html->link($sdPhanbon['Loaiphan']['TEN_LP'], array('controller' => 'loaiphans', 'action' => 'view', $sdPhanbon['Loaiphan']['id'])); ?>
		</td>
		<td>
			<?php echo $sdPhanbon['SdPhanbon']['LL_P']; ?>
		</td>
 	      <td>
			<?php  echo $sdPhanbon['Dvtinh']['tendv']/*.' '. $sdPhanbon['SdPhanbon']['DVT_P']*/; ?>
		</td>
        <td>
			<?php echo $sdPhanbon['SdPhanbon']['songay']; ?>
		</td>
		<td>
			<?php echo $sdPhanbon['Nss']['TEN_NSS']; ?>
		</td>			
	
		<td>
			<?php echo $sdPhanbon['SdPhanbon']['GHICHU_P']; ?>
		</td>
		<td class="actions">	<p align="center">
			
			<?php if ($curUser['User']['ROLE'] != 'admin')
						echo $html->link('Sửa', array('action' => 'edit', $sotayId, $sdPhanbon['SdPhanbon']['id'])); ?>
			<?php if ($curUser['User']['ROLE'] != 'admin')
					echo $html->link('Xóa', array('action' => 'delete', $sotayId, $sdPhanbon['SdPhanbon']['id']), null, sprintf(__('BẠN CÓ CHẮC MUỖN XÓA # %s?', true), $sdPhanbon['SdPhanbon']['id'])); ?> 
					
					</p>
		</td>
	</tr>
<?php endforeach; ?>
</table>
</div>
<div class="paging">
	<?php echo $paginator->prev('<< '.__('trước', true), array(), null, array('class'=>'disabled'));?>
 | 	<?php echo $paginator->numbers();?>
	<?php echo $paginator->next(__('sau', true).' >>', array(), null, array('class' => 'disabled'));?>
</div>